import VueRouter from 'vue-router'
import CarList from '../pages/CarList'
import XiangQin from '../components/XiangQin'
export default new VueRouter({
    routes: [{
            path: '*',
            redirect: '/carList'
        },
        {
            path: '/carlist',
            component: CarList
        },
        {
            name: 'xiangqing',
            path: '/xiangqin/:id?',
            component: XiangQin,
            props($route) {
                return {
                    id: $route.query.id,
                    name: $route.query.name,
                    price: $route.query.price
                }
            }
        }
    ]
})